package com.bwie.MQ;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @className: RabbitConfig
 * @Description: TODO
 * @version: v1.８.0
 * @author: GONGWENXUE
 * @date: 2025/10/10 22:25
 */
@Configuration
public class RabbitConfig {
    @Bean
    public Queue businessFollowQueue() {
        return new Queue("business.follow.queue", true);
    }

    @Bean
    public DirectExchange businessExchange() {
        return new DirectExchange("business.exchange", true, false);
    }

    @Bean
    public Binding businessFollowBinding() {
        return BindingBuilder.bind(businessFollowQueue())
                .to(businessExchange())
                .with("business.follow.key");
    }
}